package com.tepth.busfix.main.repair;

import com.tepth.busfix.bean.reponse.BusRepairHistory;
import com.tepth.busfix.network.ApiModel;
import com.tepth.busfix.network.observer.SimpleDisposableObserver;

import java.util.List;

/**
 * Created by TMVPHelper on 2017/09/07
 */
public class HistoryPresenter extends HistoryContract.Presenter {

    @Override
    void getRepairHistory() {
        mRxManager.add(mModel.getRepairHistory(mView.getAuthKey(), mView.getCode())
                .subscribeWith(new SimpleDisposableObserver<ApiModel<List<BusRepairHistory>>>(mView) {
                    @Override
                    public void onSucceed(Object o) {
                        List<BusRepairHistory> list = (List<BusRepairHistory>) o;
                        mView.showData(list);
                    }
                }));
    }
}